<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .title>div {
            display: inline-block;
            margin-right: 10px;
        }
        
        .content>div {
            position: absolute;
            margin-top: 10px;
            width: 200px;
            height: 100px;
            background-color: lightblue;
        }
        
        .active {
            z-index: 1;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="title">
            <div v-for="(value,index) in title">
                <button v-on:click="handler(index)">{{value.item}}</button>
            </div>
        </div>

        <div class="content">
            <div>
                <!-- <p v-bind:class="active">{{contents[0]["item"]}}</p>  -->
                <p>{{active}}</p>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js "></script>

    <script>
        let vm = new Vue({
            el: "#app ",
            data: {
                active: "html-contents",
                title: [{
                    item: "html "
                }, {
                    item: "css "
                }, {
                    item: "js "
                }, {
                    item: "vuejs "
                }],
                contents: [{
                    item: "html-contents"
                }, {
                    item: "css-contents"
                }, {
                    item: "js-contents"
                }, {
                    item: "vuejs-contents"
                }]
            },
            methods: {
                handler(index) {
                    this.active = this.contents[index]["item"]
                }
            }
        })
    </script>
</body>

</html>